﻿<UserControl x:Class="StreamingClient.StreamManagment.SettingsCtrl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
             xmlns:Localization="clr-namespace:StreamingClient.Localization"
             xmlns:StreamManagment="clr-namespace:StreamingClient.StreamManagment" mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    <UserControl.Resources>
        <Localization:LocalizeConverter x:Key="LocalizeEnumConverter"/>
        <Localization:Localize x:Key="Loc"/>
        <Style TargetType="TextBlock" BasedOn="{StaticResource PhoneTextSubtleStyle}">
            <Setter Property="Margin" Value="12 6 0 0"/>
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="Margin" Value="0 -12 0 -12"/>
        </Style>
        <Style TargetType="toolkit:ListPicker">
            <Setter Property="Margin" Value="12 -7 12 0"/>
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <StackPanel >
            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" Margin="12" Text="{Binding Res.Settings, Source={StaticResource Loc}}"/>
            <TextBlock Text="{Binding Res.Host, Source={StaticResource Loc}}"/>
            <TextBox Text="{Binding Settings.Host, Mode=TwoWay}" />
            <TextBlock Text="{Binding Res.Port, Source={StaticResource Loc}}"/>
            <TextBox Text="{Binding Settings.ControlPort, Mode=TwoWay}" />
            <TextBlock Text="{Binding Res.ControlPortHintWMV, Source={StaticResource Loc}}" Style="{StaticResource PhoneTextNormalStyle}" Visibility="{Binding ShowWMV,Mode=OneWay}"/>
            <TextBlock Text="{Binding Res.ControlPortHintVLC, Source={StaticResource Loc}}" Style="{StaticResource PhoneTextNormalStyle}" Visibility="{Binding ShowVLC,Mode=OneWay}"/>
            <TextBlock Text="{Binding Res.StreamPort, Source={StaticResource Loc}}" Visibility="{Binding ShowWMV,Mode=OneWay}"/>
            <TextBox Text="{Binding Settings.StreamPort, Mode=TwoWay}"  Visibility="{Binding ShowWMV,Mode=OneWay}"/>
            <TextBlock Text="{Binding Res.StreamPortHint, Source={StaticResource Loc}}" Style="{StaticResource PhoneTextNormalStyle}"  Visibility="{Binding ShowWMV,Mode=OneWay}"/>
            <StackPanel Name="ServerType">
                <TextBlock Text="{Binding Res.ServerType, Source={StaticResource Loc}}"/>
                <toolkit:ListPicker ItemsSource="{Binding Types}" SelectedItem="{Binding ServerType, Mode=TwoWay}"/>
                <TextBlock Text="{Binding Res.ServerTypeHint, Source={StaticResource Loc}}" Style="{StaticResource PhoneTextNormalStyle}"/>
            </StackPanel>
            <TextBlock Text="{Binding Res.Preset, Source={StaticResource Loc}}"/>
            <toolkit:ListPicker ItemsSource="{Binding Presets}" SelectedItem="{Binding Preset, Mode=TwoWay}">
                <toolkit:ListPicker.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Converter={StaticResource LocalizeEnumConverter}}"/>
                    </DataTemplate>
                </toolkit:ListPicker.ItemTemplate>
            </toolkit:ListPicker>
            <TextBlock Text="{Binding Res.PresetHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
            <StackPanel Visibility="{Binding ShowAdvanced, Mode=OneWay}">
                <TextBlock Style="{StaticResource PhoneTextTitle2Style}" Margin="12" Text="{Binding Res.Advanced, Source={StaticResource Loc}}"/>
                <TextBlock Text="{Binding Res.Width, Source={StaticResource Loc}}"/>
                <TextBox Text="{Binding Settings.VWidth, Mode=TwoWay}" InputScope="Number" />
                <TextBlock Text="{Binding Res.WidthHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock Text="{Binding Res.Height, Source={StaticResource Loc}}"/>
                <TextBox Text="{Binding Settings.VHeight, Mode=TwoWay}" InputScope="Number"/>
                <TextBlock Text="{Binding Res.HeightHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                <StackPanel Visibility="{Binding ShowVLC}">
                    <TextBlock Text="{Binding Res.VCodec, Source={StaticResource Loc}}"/>
                    <TextBox Text="{Binding Settings.VCodec, Mode=TwoWay}"/>
                    <TextBlock Text="{Binding Res.VCodecHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                    <TextBlock Text="{Binding Res.ACodec, Source={StaticResource Loc}}"/>
                    <TextBox Text="{Binding Settings.ACodec, Mode=TwoWay}"/>
                    <TextBlock Text="{Binding Res.ACodecHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                </StackPanel>
                <TextBlock Text="{Binding Res.FPS, Source={StaticResource Loc}}"/>
                <TextBox Text="{Binding Settings.VFps, Mode=TwoWay}" InputScope="Number"/>
                <TextBlock Text="{Binding Res.FPSHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock Text="{Binding Res.VBitrate, Source={StaticResource Loc}}"/>
                <TextBox Text="{Binding Settings.VBitrate, Mode=TwoWay}" InputScope="Number"/>
                <TextBlock Text="{Binding Res.VBitrateHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock Text="{Binding Res.ABitrate, Source={StaticResource Loc}}"/>
                <TextBox Text="{Binding Settings.ABitrate, Mode=TwoWay}" InputScope="Number"/>
                <TextBlock Text="{Binding Res.ABitrateHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock Text="{Binding Res.AChannels, Source={StaticResource Loc}}"/>
                <TextBox Text="{Binding Settings.AChannels, Mode=TwoWay}" InputScope="Number"/>
                <TextBlock Text="{Binding Res.AChannelsHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock Text="{Binding Res.ASampleRate, Source={StaticResource Loc}}"/>
                <TextBox Text="{Binding Settings.ASampleRate, Mode=TwoWay}" InputScope="Number"/>
                <TextBlock Text="{Binding Res.ASampleRateHint, Source={StaticResource Loc}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
            </StackPanel>
            <TextBlock Height="150"></TextBlock>
        </StackPanel>
    </Grid>
</UserControl>
